package com.lightningtrade.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@ApiModel(value = "SysReview", description = "评价信息")
public class SysReview {
    @ApiModelProperty(value = "评价编号", example = "1", notes = "自动生成的唯一ID")
    private int id;

    @ApiModelProperty(value = "订单编号", example = "10001", notes = "关联的订单ID")
    @Min(value = 10000, message = "订单编号必须大于10000")
    private long orderId;

    @ApiModelProperty(value = "用户编号", example = "1", notes = "评价的用户ID")
    @NotNull(message = "用户编号不能为空")
    private int userId;

    @ApiModelProperty(value = "商品编号", example = "1", notes = "被评价商品的ID")
    @NotNull(message = "商品编号不能为空")
    private int productId;

    @ApiModelProperty(value = "评分", example = "5", notes = "评分字段，取值范围：1-5")
    @NotNull(message = "评分不能为空")
    private byte rating; // 评分字段，使用byte，TINYINT 存储

    @ApiModelProperty(value = "评价内容", example = "这件商品非常好", notes = "用户的评价内容")
    private String content;

    @ApiModelProperty(value = "创建时间", example = "2024-12-08T12:30:00", notes = "评价的创建时间")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间", example = "2024-12-08T12:30:00", notes = "评价的最后更新时间")
    private Date updatedAt;

    // Getter and Setter methods

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public byte getRating() {
        return rating;
    }

    public void setRating(byte rating) {
        this.rating = rating;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
}
